<?php

/**
 * LEAGUEMan
 * 
 * Copyright (C) 2007 Marko Bischof
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

?>

<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
		
		if (form.eventtype_name.value == ""){
			alert('Must have a name');
		}
		else {
			submitform( pressbutton );
		}
	}
</script>

<form action="index2.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
	<table cellpadding="4" cellspacing="0" border="0" width="100%">
		<tr>
			<td width="100%"><span class="sectionname"><?php echo $this->row->getID() ? 'Edit' : 'Add';?> Eventtype</span></td>
		</tr>
	</table>

	<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
		<tr>
			<td width="20%" align="right"><b><?php echo 'Name';?>:</b></td>
			<td width="80%">
				<input class="inputbox" type="text" name="eventtype_name" size="50" value="<?php echo $this->row->getName();?>" />
			</td>
		</tr>
		<tr>
			<td width="20%" align="right"><b><?php echo 'Title';?>:</b></td>
			<td width="80%">
				<input class="inputbox" type="text" name="eventtype_title" size="50" value="<?php echo $this->row->getTitle();?>" />
			</td>
		</tr>
		<tr>
			<td width="20%" align="right"><b><?php echo 'Association';?>:</b></td>
			<td width="80%">
				<?php echo $this->row->getAssociation();?>
			</td>
		</tr>
		<tr>
			<td width="20%" align="right"><b><?php echo 'Icon';?>:</b></td>
			<td width="80%">
				<input type="file" name="upload" size="40" class="text_area" />
			</td>
		</tr>
		<tr>
			<td width="20%" align="right">&nbsp;</td>
			<td width="80%"></td>
		</tr>
	</table>
	
	
	<input type="hidden" name="eventtype_id" value="<?php echo $this->row->getID(); ?>" />
	<input type="hidden" name="playermap_association" value="<?php echo $this->row->getAssociation(); ?>" />
	<input type="hidden" name="option" value="com_leagueman" />
	<input type="hidden" name="act" value="eventtypes" />
	<input type="hidden" name="task" value="" />
</form>